<template>

  <h2>当前计数{{counter}}</h2>
  <button @click="increment">+1</button>
</template>

<script>
import { ref ,readonly} from "vue";

export default {

  setup() {
    let counter = ref(100);
    //局部函数
    const increment = ()=>{
      counter.value++;
    }
    //进行响应式的处理

    return {
      counter,
      increment
    }
  }

}
</script>

<style scoped>

</style>